﻿using Basic.HrRemoteModel.DicItem.Model;
using Basic.HrRemoteModel.TreeDic;
using Basic.HrRemoteModel.TreeDic.Model;
using WeDonekRpc.Client.Attr;

namespace Basic.FormExtendService.lmpl
{
    [ClassLifetimeAttr(ClassLifetimeType.SingleInstance)]
    internal class TreeDicService : ITreeDicService
    {
        public string[] FindDictValue ( TreeDicItemFind param )
        {
            return new FindTreeDicItemValue
            {
                Param = param
            }.Send();
        }

        public Dictionary<string, string> GetNames ( long dicId, string[] vals )
        {
            return new GetTreeNameDic
            {
                DicId = dicId,
                Values = vals
            }.Send();
        }

        public TreeItemName[] GetNames ( Dictionary<long, string[]> dic )
        {
            return new BatchGetTreeName
            {
                Param = dic
            }.Send();
        }

        public DicItem[] GetNames ( long dicId, bool isEnd )
        {
            return new GetTreeItemList
            {
                DicId = dicId,
                IsEnd = isEnd
            }.Send();
        }
    }
}
